﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
using FarmerJoe.ClassSettings;
using FarmerJoe.Settings;
using Styx;
using Styx.WoWInternals.WoWObjects;

namespace FarmerJoe
{
    public partial class ucWarlockSetting : UserControl
    {
                private bool _isLoading = true;

                
        public ucWarlockSetting()
        {
            InitializeComponent();
            PopulateUIControls();

            switch (StyxWoW.Me.Specialization)
            {
                case WoWSpec.WarlockAffliction:
                    tabControl1.SelectTab("Affliction");
                    break;

                case WoWSpec.WarlockDestruction:
                    tabControl1.SelectTab("Destruction");
                    break;

                case WoWSpec.WarlockDemonology:
                    tabControl1.SelectTab("Demonology");
                    break;

            }

            _isLoading = false;
        }

        private void CommonPetAdditionals()
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.lblDescription.Text = "Choose when to cast your pets spells";

            //if (StyxWoW.Me.Specialization == WoWSpec.WarlockDemonology)
            string petInUse = null;
            if (StyxWoW.Me.Specialization == WoWSpec.WarlockDestruction) petInUse = ucDestructionSummonPet.Value;
            if (StyxWoW.Me.Specialization == WoWSpec.WarlockAffliction) petInUse = ucAfflictionSummonPet.Value;
            if (StyxWoW.Me.Specialization == WoWSpec.WarlockDemonology) petInUse = ucDemoSummonPet.Value;

            switch (petInUse)
            {
                case "Wrathguard":
                case "Felguard":
                    frm2.AddDropDown("Axe Toss", "PetAxeToss", new List<string>() { "... always", "... never", "... only on casters", "... only on runners", "... on casters and runners" }, "", "");
                    frm2.AddDropDown("Warth Storm", "PetWrathStorm", new List<string>() { "... always", "... never", "... only on adds", "... only on 3+ adds", "... only on 4+ adds", "... only on 5+ adds" }, "", "");
                    frm2.FormHeading = "Felguard Pet Spells";
                    break;

                case "Succubus":
                    frm2.AddDropDown("Whiplash", "PetWhiplash", new List<string>() { "... always", "... never", "... only on casters" }, "Whiplash", "This also applies to Fellash on the Shivarra");
                    frm2.FormHeading = "Succubus Pet Spells";
                    break;

                case "Felhunter":
                    frm2.AddDropDown("Spell Lock", "PetSpellLock", new List<string>() { "... always", "... never", "... only on casters" }, "Spell Lock", "This also applies to Optical Blast on the Observer");
                    frm2.FormHeading = "Felhunter Pet Spells";
                    break;

                case "Imp":
                    frm2.AddDropDown("Cauterize Master", "PetCauterizeMaster", new List<string>() { "... always", "... never" }, "", "");
                    frm2.AddProgressBar("Your Health", "PetCauterizeMasterHealth", 0, 100, "", "");
                    frm2.FormHeading = "Imp Pet Spells";
                    break;
            }


            frm2.Show(this);
        }

        private void PopulateUIControls()
        {
            SuspendLayout();

            Type type = typeof(WarlockSettings); PropertyInfo[] settingsProperties = type.GetProperties();
            foreach (PropertyInfo setting in settingsProperties)
            {
                PropertyInfo pInfo = type.GetProperty(setting.Name);
                object propValue = pInfo.GetValue(FpswareSettings.Instance.Warlock, null);

                foreach (GroupBox gb in from TabPage tab in tabControl1.Controls from GroupBox gb in tab.Controls select gb)
                    foreach (object obj in gb.Controls)
                    {
                        // Populate all combo boxes, this will be the most common
                        if (obj is ucDropdown)
                        {
                            var cbox = (ucDropdown) obj;

                            cbox.ValueChanged += ucControl_ValueChanged;
                            if (cbox.SettingName == setting.Name && cbox.Value != propValue.ToString())
                            {
                                cbox.Value = propValue.ToString();
                                break;
                            }
                        }

                            // Populate all progress bars, mostly for health or mana 
                        else if (obj is ucProgressBar)
                        {
                            var pbar = (ucProgressBar) obj;

                            pbar.ValueChanged += ucControl_ValueChanged;

                            if (pbar.SettingName == pInfo.Name)
                            {
                                pbar.Value = (int) propValue;
                                break;
                            }
                        }
                    }
            }

            _isLoading = false;
            ResumeLayout();
        }

       
        private void ucControl_ValueChanged(object sender, EventArgs e)
        {
            // Basically enumerate the [Druid] setting class and find the Property that matches the name of 'e.SettingName' and assign the value of 'e.Value'
            // This saves us creating code for every item / setting and adds reusability

            if (_isLoading) return;

            Type type = typeof(WarlockSettings); PropertyInfo[] settingsProperties = type.GetProperties();
            foreach (PropertyInfo setting in settingsProperties.Where(setting => e.SettingName == setting.Name))
            {
                setting.SetValue(FpswareSettings.Instance.Warlock, e.Value, null);
            }
        }

        private void ucControl_ValueChanged(object sender, cbEventArgs e)
        {
            // Basically enumerate the [Druid] setting class and find the Property that matches the name of 'e.SettingName' and assign the value of 'e.Value'
            // This saves us creating code for every item / setting and adds reusability

            if (_isLoading) return;

            Type type = typeof(WarlockSettings); PropertyInfo[] settingsProperties = type.GetProperties();
            foreach (PropertyInfo setting in settingsProperties.Where(setting => e.SettingName == setting.Name))
            {
                setting.SetValue(FpswareSettings.Instance.Warlock, e.Value, null);
            }
        }

        private void ucDarkBargin_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddDropDown("When", "DestructionDarkBarginWhen", new List<string>() { "... always", "... only on adds", "... only on 3+ adds", "... only on 4+ adds", "... only on 5+ adds" }, "Dark Bargin", "When to evaluate Dark Bargin");
            frm2.AddProgressBar("Health", "DestructionDarkBarginHealth", 0, 100, "Dark Bargin", "The health percent at which you will cast Dark Bargin");

            frm2.FormHeading = "Dark Bargin";
            frm2.lblDescription.Visible = true;
            frm2.lblDescription.Text = "For example: When your health is below 85% [Health] and you have 3+ adds [When] cast Dark Bargin";

            frm2.Show(this);
        }

        private void ucSacrificialPact_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddDropDown("When", "DestructionSacrificialPactWhen", new List<string>() { "... always", "... only on adds", "... only on 3+ adds", "... only on 4+ adds", "... only on 5+ adds" }, "Sacrificial Pact", "When to evaluate Sacrificial Pact");
            frm2.AddProgressBar("Health", "DestructionSacrificialPactHealth", 0, 100, "Sacrificial Pact", "The health percent at which you will cast Sacrificial Pact");
            frm2.AddProgressBar("Min Pet Health", "DestructionSacrificialPactMinPetHealth", 0, 100, "Sacrificial Pact", "The minimum health percent your pet must be to cast Sacrificial Pact");

            frm2.FormHeading = "Sacrificial Pact";
            frm2.lblDescription.Visible = true;
            frm2.lblDescription.Text = "For example: When your health is below 85% [Health] and you have 3+ adds [When] and your Pet's health is more than 60% [Min Pet Health] cast Sacrificial Pact";

            frm2.Show(this);
        }

        private void ucFireAndBrimstone_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddDropDown("When", "FireAndBrimstoneWhen", new List<string>() { "... always", "... only on adds", "... only on 3+ adds", "... only on 4+ adds", "... only on 5+ adds" }, "Fire and Brimstone", "When to evaluate Sacrificial Pact");
            frm2.AddDropDown("Burning Embers", "FireAndBrimstoneBurningEmberCount", new List<string>() { "1", "2", "3", "4" }, "Fire and Brimstone", "Minimum number of Burning Embers required");

            frm2.FormHeading = "Fire and Brimstone";
            frm2.lblDescription.Visible = true;
            frm2.lblDescription.Text = "For example: When you have 3+ mobs [when] and you have 2 [Burning Embers] or more embers cast Fire and Brimstone";

            frm2.Show(this);
        }

        private void ucDemoCorruption_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddDropDown("DoT Adds", "DemoCorruptionDOTAdds", new List<string>() { "... always", "... never"}, "", "");

            frm2.FormHeading = "Corruption DoT Adds";
            frm2.lblDescription.Visible = true;
            frm2.lblDescription.Text = "Enable / disable dotting all adds with Corruption";

            frm2.Show(this);
        }

        private void ucDemoDarkBargin_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddDropDown("When", "DemoDarkBarginWhen", new List<string>() { "... always", "... only on adds", "... only on 3+ adds", "... only on 4+ adds", "... only on 5+ adds" }, "Dark Bargin", "When to evaluate Dark Bargin");
            frm2.AddProgressBar("Health", "DemoDarkBarginHealth", 0, 100, "Dark Bargin", "The health percent at which you will cast Dark Bargin");

            frm2.FormHeading = "Dark Bargin";
            frm2.lblDescription.Visible = true;
            frm2.lblDescription.Text = "For example: When your health is below 85% [Health] and you have 3+ adds [When] cast Dark Bargin";

            frm2.Show(this);
        }

        private void ucImmolationAura_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {

        }

        private void ucSoulLink_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddProgressBar("Pet Health", "DemoHealPetHealth", 0, 100, "Pet Heal", "When your pet's health is below this percent then cast Drain Life");

            frm2.FormHeading = "Soul Link Pet Heal";
            frm2.lblDescription.Visible = true;
            frm2.lblDescription.Text = "For example: If your pet's health is below 65% [Pet Health] cast Drain Life on your current target";

            frm2.Show(this);
        }

        private void ucLifeTap_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddProgressBar("Mana", "DemoLifeTapMana", 0, 100, "Life Tap", "When your mana is below this percent cast Life Tap");
            frm2.AddProgressBar("Min Health", "DemoLifeTapMinHealth", 0, 100, "Life Tap", "Do not life tap when your health is below this percent");

            frm2.FormHeading = "Life Tap";
            frm2.lblDescription.Visible = true;
            frm2.lblDescription.Text = "For example: If your mana is below 40% [Mana] and your health is above 60% [Min Health] cast Life Tap";

            frm2.Show(this);
        }

        private void ucDemoPull_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddDropDown("Soul Fire", "DemoPullSoulFire", new List<string>() { "... always", "... never"}, "Pull", "Will only use if Molten Core buff is present");
            frm2.AddDropDown("Hand of Gul'dan", "DemoPullHandOfGuldan", new List<string>() { "... always", "... never" }, "", "");
            frm2.AddDropDown("Corruption", "DemoPullCorruption", new List<string>() { "... always", "... never" }, "", "");
            frm2.AddDropDown("Shadow Bolt", "DemoPullShadowBolt", new List<string>() { "... always", "... never" }, "", "");

            frm2.FormHeading = "Pull";
            frm2.lblDescription.Visible = true;
            frm2.lblDescription.Text = "Choose the spells you want to use when pulling. Note, pull spells are evaluated in the above order.";

            frm2.Show(this);
        }

        private void ucDemoSummonPet_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            CommonPetAdditionals();
        }

        private void ucDrainSoul_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddProgressBar("Finisher Health", "AfflictionDrainSoulFinisherHealth", 0, 100, "Drain Soul", "When the target's healh is below this % cast Drain Soul. Default 25%");
            frm2.AddDropDown("Combat Min Shards", "AfflictionDrainSoulCombatMinShards", new List<string>() { "... never", "0","1","2","3" }, "Drain Soul", "When in combat and you have this many Soul Shards or less cast Drain Soul");

            frm2.FormHeading = "Drain Soul";
            frm2.lblDescription.Visible = true;
            frm2.lblDescription.Text = "For example: When in combat and you have <2 Shards [Combat Min Shards] cast Drain Soul. Or when target's HP% < 25 cast Drain Soul";

            frm2.Show(this);
        }


        private void ucAfflictionCotE_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddDropDown("Soulburn on Adds", "AfflictionCurseOfTheElementsSoulburnAdds", new List<string>() { "... never", "... only on adds", "... only on 3+ adds", "... only on 4+ adds", "... only on 5+ adds" }, "Soul Burn", "Cast Soulburn if you have this many adds within 15 yards of the target before applying CotE");

            frm2.FormHeading = "Curse of the Elements";
            frm2.lblDescription.Visible = true;
            frm2.lblDescription.Text = "For example: When you have 3+ adds [Soulburn on Adds] use Soulburn before casting Curse of the Elements, this applies CotE to all adds";

            frm2.Show(this);
        }

        private void ucAfflictionCorruption_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddDropDown("DoT Adds", "AfflictionCorruptionAdds", new List<string>() { "... never", "... always", "... only on 3+ adds", "... only on 4+ adds", "... only on 5+ adds" }, "", "");

            frm2.FormHeading = "Corruption";
            frm2.lblDescription.Visible = true;
            frm2.lblDescription.Text = "For example: When you have 3+ adds [DoT Adds] cast Corruption on them all";

            frm2.Show(this);
        }

        private void ucAfflictionAgony_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddDropDown("DoT Adds", "AfflictionAgonyAdds", new List<string>() { "... never", "... always", "... only on 3+ adds", "... only on 4+ adds", "... only on 5+ adds" }, "", "");

            frm2.FormHeading = "Agony";
            frm2.lblDescription.Visible = true;
            frm2.lblDescription.Text = "For example: When you have 3+ adds [DoT Adds] cast Agony on them all";

            frm2.Show(this);
        }

        private void ucUnstableAffliction_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddDropDown("DoT Adds", "AfflictionUnstableAfflictionAdds", new List<string>() { "... never", "... always", "... only on 3+ adds", "... only on 4+ adds", "... only on 5+ adds" }, "", "");
            frm2.AddProgressBar("Min Health", "AfflictionUnstableAfflictionMinHealth", 0, 100, "Unstable Affliction", "The minimum health % at which Unstable Affliction will be cast on the target");

            frm2.FormHeading = "Unstable Affliction";
            frm2.lblDescription.Visible = true;
            frm2.lblDescription.Text = "For example: When you have 3+ adds [DoT Adds] cast Unstable Affliction on them all";

            frm2.Show(this);
        }

        private void ucHaunt_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddDropDown("DoT Adds", "AfflictionHauntAdds", new List<string>() { "... never", "... always", "... only on 3+ adds", "... only on 4+ adds", "... only on 5+ adds" }, "", "");
            frm2.AddProgressBar("Min Health", "AfflictionHauntMinHealth", 0, 100, "Haunt", "The minimum health % at which Haunt will be cast on the target");

            frm2.FormHeading = "Haunt";
            frm2.lblDescription.Visible = true;
            frm2.lblDescription.Text = "For example: When you have 3+ adds [DoT Adds] cast Haunt on them all";

            frm2.Show(this);
        }

        private void ucSeedOfCorruption_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddDropDown("When", "AfflictionSeedOfCorruptionSoulburn", new List<string>() { "... never", "... only on adds", "... only on 3+ adds", "... only on 4+ adds", "... only on 5+ adds" }, "Seed of Corruption", "Cast Seed of Corruption when you have this many adds");
            frm2.AddDropDown("Soulburn", "AfflictionSeedOfCorruptionSoulburn", new List<string>() { "... never", "... always"}, "Soul Burn", "Cast Soulburn if these adds are within 15 yards of the target in order to spread Corruption");

            frm2.FormHeading = "Seed of Corruption";
            frm2.lblDescription.Visible = true;
            frm2.lblDescription.Text = "For example: When you have 3+ adds [When] cast Seed of Corruption, and always [Soulburn] use Soulburn in order to spread Corruption";

            frm2.Show(this);
        }

        private void ucSoulSwap_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddDropDown("Soulburn on Adds", "AfflictionSoulSwapSoulburn", new List<string>() { "... never", "... always", "... only on 3+ adds", "... only on 4+ adds", "... only on 5+ adds" }, "Soul Burn", "Cast Soulburn if you have this many adds within 15 yards of the target");

            frm2.FormHeading = "Soul Swap";
            frm2.lblDescription.Visible = true;
            frm2.lblDescription.Text = "For example: When you have adds [Soulburn on Adds] use Soulburn before casting Soul Swap to apply all DoTs";

            frm2.Show(this);
        }

        private void ucAfflictionDarkBargin_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddDropDown("When", "AfflictionDarkBarginWhen", new List<string>() { "... always", "... only on adds", "... only on 3+ adds", "... only on 4+ adds", "... only on 5+ adds" }, "Dark Bargin", "When to evaluate Dark Bargin");
            frm2.AddProgressBar("Health", "AfflictionDarkBarginHealth", 0, 100, "Dark Bargin", "The health percent at which you will cast Dark Bargin");

            frm2.FormHeading = "Dark Bargin";
            frm2.lblDescription.Visible = true;
            frm2.lblDescription.Text = "For example: When your health is below 85% [Health] and you have 3+ adds [When] cast Dark Bargin";

            frm2.Show(this);
        }

        private void ucAfflictionSummonPet_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            CommonPetAdditionals();
        }

        private void ucAfflictionSoulLink_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddProgressBar("Pet Health", "AfflictionHealPetHealth", 0, 100, "Pet Heal", "When your pet's health is below this percent then cast Drain Life");

            frm2.FormHeading = "Soul Link Pet Heal";
            frm2.lblDescription.Visible = true;
            frm2.lblDescription.Text = "For example: If your pet's health is below 65% [Pet Health] cast Drain Life on your current target";

            frm2.Show(this);
        }

        private void ucAfflictionGrimoireOfService_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddDropDown("Pet", "AfflictionGrimoirePet", new List<string>() { "Imp", "Voidwalker", "Succubus", "Felhunter" }, "Grimoire of Service", "Choose the pet you want to summon when using this Grimoire");
            frm2.FormHeading = "Grimoire of Service Pet";
            frm2.lblDescription.Visible = false;
            frm2.lblDescription.Text = "";

            frm2.Show(this);
        }

        private void ucAfflictionPull_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddDropDown("Soulburn Soul Swap", "AfflictionPullSoulburnSoulSwap", new List<string>() { "... always", "... never" }, "", "");
            frm2.AddDropDown("Unstable Affliction", "AfflictionPullUnstableAffliction", new List<string>() { "... always", "... never" }, "", "");
            frm2.AddDropDown("Haunt", "AfflictionPullHaunt", new List<string>() { "... always", "... never" }, "", "");
            frm2.AddDropDown("Corruption", "AfflictionPullCorruption", new List<string>() { "... always", "... never" }, "", "");
            frm2.AddDropDown("Malefic Grasp", "AfflictionPullMaleficGrasp", new List<string>() { "... always", "... never" }, "", "");

            frm2.FormHeading = "Pull";
            frm2.lblDescription.Visible = true;
            frm2.lblDescription.Text = "Choose the spells you want to use when pulling. Note, pull spells are evaluated in the above order.";

            frm2.Show(this);
        }

        private void ucAfflictionLifeTap_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddProgressBar("Mana", "AfflictionLifeTapMana", 0, 100, "Life Tap", "When your mana is below this percent cast Life Tap");
            frm2.AddProgressBar("Min Health", "AfflictionLifeTapMinHealth", 0, 100, "Life Tap", "Do not life tap when your health is below this percent");

            frm2.FormHeading = "Life Tap";
            frm2.lblDescription.Visible = true;
            frm2.lblDescription.Text = "For example: If your mana is below 40% [Mana] and your health is above 60% [Min Health] cast Life Tap";

            frm2.Show(this);
        }

        private void ucDestructionSummonPet_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            CommonPetAdditionals();
        }

        private void ucDrainLife_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddDropDown("Soulburn", "AfflictionDrainLifeSoulburn", new List<string>() { "... always", "... never" }, "Soulburn", "Cast Soulburn when using Drain Life");
            frm2.AddDropDown("Min Shards", "AfflictionDrainLifeSoulburnMinShards", new List<string>() { "1", "2", "3", "4", }, "Soulburn", "The minimum number of Soul Shards you must have before using Soulburn");
            frm2.AddDropDown("Priority", "AfflictionDrainLifePriority", new List<string>() { "... high", "... medium", "... low" }, "Drain Life Priority", "Choose how important it is to cast Drain Life in the rotation. Default: Medium, permits DoTs to be applied to your current target only");
            frm2.FormHeading = "Drain Life Soulburn";
            frm2.lblDescription.Visible = false;
            frm2.lblDescription.Text = "";

            frm2.Show(this);
        }

        private void ucGrimoireOfService_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddDropDown("Pet", "DemoGrimoirePet", new List<string>() { "Imp", "Voidwalker","Succubus", "Felhunter", "Felguard" }, "Grimoire of Service", "Choose the pet you want to summon when using this Grimoire");
            frm2.FormHeading = "Grimoire of Service Pet";
            frm2.lblDescription.Visible = false;
            frm2.lblDescription.Text = "";

            frm2.Show(this);
        }

        private void ucDestructionGrimoireOfService_AdditionalsButtonPressed(object sender, System.ComponentModel.AddingNewEventArgs e)
        {
            uiExtendedOptions frm2 = new uiExtendedOptions();
            frm2.ShowLogicProcess = false;
            frm2.AddDropDown("Pet", "DestructionGrimoirePet", new List<string>() { "Imp", "Voidwalker", "Succubus", "Felhunter" }, "Grimoire of Service", "Choose the pet you want to summon when using this Grimoire");
            frm2.FormHeading = "Grimoire of Service Pet";
            frm2.lblDescription.Visible = false;
            frm2.lblDescription.Text = "";

            frm2.Show(this);
        }


    }
}
